package com.smart.community.work.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 请假记录VO
 *
 * @author Wu.Liang
 * @since 2025-01-30
 * @version 1.0.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(description = "请假记录VO")
public class LeaveVO {

    @Schema(description = "请假记录ID", example = "1")
    private Long id;

    @Schema(description = "用户ID", example = "1")
    private Long userId;

    @Schema(description = "物业公司ID", example = "1")
    private Long propertyCompanyId;

    @Schema(description = "请假类型：personal-事假，sick-病假，annual-年假，compensatory-调休", example = "personal")
    private String leaveType;

    @Schema(description = "请假类型名称", example = "事假")
    private String leaveTypeName;

    @Schema(description = "开始日期", example = "2025-01-30")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private java.time.LocalDate startDate;

    @Schema(description = "结束日期", example = "2025-01-30")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private java.time.LocalDate endDate;

    @Schema(description = "开始时间", example = "09:00:00")
    @JsonFormat(pattern = "HH:mm:ss")
    private java.time.LocalTime startTime;

    @Schema(description = "结束时间", example = "18:00:00")
    @JsonFormat(pattern = "HH:mm:ss")
    private java.time.LocalTime endTime;

    @Schema(description = "请假天数", example = "1.0")
    private BigDecimal days;

    @Schema(description = "请假时长（小时）", example = "8.0")
    private BigDecimal duration;

    @Schema(description = "请假原因", example = "家中有事需要处理")
    private String reason;

    @Schema(description = "审批状态：1-待审批，2-已批准，3-已拒绝，4-已撤销", example = "1")
    private Integer status;

    @Schema(description = "审批状态名称", example = "待审批")
    private String statusName;

    @Schema(description = "审批人ID", example = "2")
    private Long approverId;

    @Schema(description = "审批人姓名", example = "李经理")
    private String approverName;

    @Schema(description = "审批时间", example = "2025-01-30 10:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime approveTime;

    @Schema(description = "审批备注", example = "同意请假申请")
    private String approveRemark;

    @Schema(description = "附件URL", example = "http://example.com/attachment.pdf")
    private String attachmentUrl;

    @Schema(description = "附件信息（JSON格式）", example = "[{\"id\":1,\"fileName\":\"病假证明.pdf\",\"url\":\"http://example.com/file.pdf\",\"fileSize\":1024}]")
    private String attachments;

    @Schema(description = "备注", example = "特殊情况说明")
    private String remark;

    @Schema(description = "物业公司名称", example = "智慧物业有限公司")
    private String propertyCompanyName;

    @Schema(description = "创建人ID", example = "1")
    private Long createBy;

    @Schema(description = "创建时间", example = "2025-01-30 09:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @Schema(description = "更新人ID", example = "1")
    private Long updateBy;

    @Schema(description = "更新时间", example = "2025-01-30 10:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @Schema(description = "用户名", example = "张三")
    private String username;

    @Schema(description = "用户真实姓名", example = "张三")
    private String realName;

    @Schema(description = "用户姓名（用于显示）", example = "张三")
    private String userName;

    @Schema(description = "部门名称", example = "客服部")
    private String departmentName;

    @Schema(description = "职位名称", example = "客服专员")
    private String positionName;

    @Schema(description = "是否可审批", example = "true")
    private Boolean canApprove = false;

    @Schema(description = "是否可编辑", example = "true")
    private Boolean canEdit = false;

    @Schema(description = "是否可删除", example = "true")
    private Boolean canDelete = false;
}
